package com.cungmua.app.model.request;

import com.cungmua.app.utils.AppUtils;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by kelvin.nguyen on 7/2/14.
 */
public class ChangePassRequest extends AuthenticatedRequest {
    private int userId;
    private String oldPass;
    private String newPass;

    public ChangePassRequest(String deviceId, String token) {
        super(deviceId, token);
    }

    @JsonProperty("UserId")
    public int getUserId() {
        return userId;
    }

    @JsonProperty("OldPass")
    public String getOldPass() {
        return oldPass;
    }

    @JsonProperty("NewPass")
    public String getNewPass() {
        return newPass;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public void setOldPass(String oldPass) {
        this.oldPass = oldPass;
    }

    public void setNewPass(String newPass) {
        this.newPass = newPass;
    }

    @Override
    public String getSign() {
        return AppUtils.MD5(String.valueOf(getUserId()) + getOldPass() + getNewPass() +
                getVersion() + getDeviceId() + getToken());
    }
}